package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 衷岚
 * @version 1.0
 */
@Mapper
public interface SetmealDishMapper {

    List<SetmealDish> findByDishIds(List<Long> dishIds);

    /**
     * 删除套餐内的菜品信息
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);

    /**
     * 新增套餐的菜品信息
     * @param setmealDishList
     */
    void add(List<SetmealDish> setmealDishList);

    /**
     * 查询套餐中停售菜品数量
     * @param id
     * @return
     */
    int countDishStopStatus(Long id);


    /**
     * 批量删除套餐关联的菜品信息
     * @param setmealIds
     */
    void deleteBatchBySetmealId(List<Long> setmealIds);

    /**
     *查询套餐关联的菜品数据
     * @param setmealId
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> findBySetmealId(Long setmealId);

}
